package com.oa.co.service.impl;
/*
 *                                                     __----~~~~~~~~~~~------___
 *                                    .  .   ~~//====......          __--~ ~~
 *                    -.            \_|//     |||\\  ~~~~~~::::... /~
 *                 ___-==_       _-~o~  \/    |||  \\            _/~~-
 *         __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
 *     _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
 *   .~       .~       |   \\ -_    /  /-   /   ||      \   /
 *  /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
 *  |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
 *           '         ~-|      /|    |-~\~~       __--~~
 *                       |-~~-_/ |    |   ~\_   _-~            /\
 *                            /  \     \__   \/~                \__
 *                        _--~ _/ | .-~~____--~-/                  ~~==.
 *                       ((->/~   '.|||' -_|    ~~-/ ,              . _||
 *                                  -_     ~\      ~~---l__i__i__i--~~_/
 *                                  _-~-__   ~)  \--______________--~~
 *                                //.-~~~-~_--~- |-------~~~~~~~~
 *                                       //.-~~~--\
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *                               神兽保佑            永无BUG
 */

import com.oa.co.common.R;
import com.oa.co.mapper.TypeMapper;
import com.oa.co.pojo.Type;
import com.oa.co.service.ScheduleService;
import com.oa.co.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author sunXuDong
 * @data 2023/5/7
 */
@Service("typeService")
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeMapper typeMapper;
//    @Autowired
//    private TravelRequestServiceImpl travelRequestService;
//    @Autowired
//    private ScheduleService scheduleService;

    @Override
    public R queryById(Integer type_id) {

        List<Type> list = typeMapper.queryById(type_id);

        return list != null ? R.ok().data("list",list) : R.error().message("系统错误");
    }

    @Override
    public R applicant(String applicant) {
        List<Type> list = typeMapper.applicant(applicant);
        return list != null ? R.ok().data("list",list) : R.error().message("系统错误");
    }

//    select t.*,ty.t_name from travel_request as t join schedule as s on t.t_id=s.t_id join type as ty on
//    t.t_id =ty.t_id where ty.type_id=6 and t.applicant='小萝卜' and s.d_code=7


}
